<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <c:choose>
            <c:when test="#{not pacienteBean.editable}">
                <title>Cadastro de pacientes</title>
            </c:when>
            <c:otherwise>
                <title>Editar paciente</title>
            </c:otherwise>
        </c:choose>
    </h:head>
    <h:body>
        <f:view>
            <h:form id="paciente">
                <fieldset>
                    <legend>Paciente</legend>
                    <h:outputText value="Nome: " />
                    <h:inputText id="nome" value="#{pacienteBean.paciente.nome}" /><br />
                    <h:outputText value="CPF: " />
                    <h:inputText id="cpf" value="#{pacienteBean.paciente.cpf}" /><br />
                    <h:outputText value="RG: " />
                    <h:inputText id="rg" value="#{pacienteBean.paciente.rg}" /><br />
                    <h:outputText value="Endereço: " />
                    <h:inputText id="endereco" value="#{pacienteBean.paciente.endereco}" /><br />

<!--                    <h:selectOneMenu id="selectCar" value="#{carBean.currentCar}">
                      <f:selectItems value="#{carBean.carList}" />
                    </h:selectOneMenu>

                    <select id="jsftags:selectCar"
                     name="jsftags:selectCar" size="1">
                      <option value="accord">Honda Accord</option>
                      <option value="4runner">Toyota 4Runner</option>
                      <option value="nissan-z">Nissan Z350</option>
                    </select>-->

                    <h:selectOneMenu id="selectPlano" value="#{pacienteBean.paciente.plano}" >
                        <f:selectItems value="#{planoBean.planos}"/>
                    </h:selectOneMenu>
                    <h:commandButton id="update" type="submit" rendered="#{pacienteBean.editable}" action="#{pacienteBean.update}" value="Atualizar" />
                    <h:commandButton id="create" type="submit" rendered="#{not pacienteBean.editable}" action="#{pacienteBean.create}" value="Cadastrar" />
                </fieldset>
            </h:form>
        </f:view>
    </h:body>
</html>

